.class public Lcom/glympse/android/glympse/DlgFacebookSettings;
.super Lcom/glympse/android/glympse/DlgShell;
.source "DlgFacebookSettings.java"

# interfaces
.implements Lcom/glympse/android/glympse/DlgShell$DlgShellListener;
.implements Lcom/glympse/android/glympseservice/FacebookWrapper$FacebookStatusChange;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/glympse/android/glympse/DlgFacebookSettings$OnClickListenerSignInOut;
    }
.end annotation


# instance fields
.field private m_fAddRecipientWhenDone:Z

.field private m_oButtonAction:Landroid/widget/Button;

.field private m_oSpinnerScope:Landroid/widget/Spinner;

.field private m_oTextName:Landroid/widget/TextView;

.field private m_oTextStatus:Landroid/widget/TextView;


# direct methods
.method public constructor <init>(Landroid/content/Context;Z)V
    .locals 3
    .parameter "oContext"
    .parameter "fAddRecipientWhenDone"

    .prologue
    const/4 v2, 0x0

    .line 40
    const v0, 0x7f030007

    const v1, 0x7f0b001d

    invoke-direct {p0, p1, v2, v0, v1}, Lcom/glympse/android/glympse/DlgShell;-><init>(Landroid/content/Context;Ljava/lang/String;II)V

    .line 31
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/glympse/android/glympse/DlgFacebookSettings;->m_fAddRecipientWhenDone:Z

    .line 32
    iput-object v2, p0, Lcom/glympse/android/glympse/DlgFacebookSettings;->m_oTextStatus:Landroid/widget/TextView;

    .line 33
    iput-object v2, p0, Lcom/glympse/android/glympse/DlgFacebookSettings;->m_oTextName:Landroid/widget/TextView;

    .line 34
    iput-object v2, p0, Lcom/glympse/android/glympse/DlgFacebookSettings;->m_oButtonAction:Landroid/widget/Button;

    .line 35
    iput-object v2, p0, Lcom/glympse/android/glympse/DlgFacebookSettings;->m_oSpinnerScope:Landroid/widget/Spinner;

    .line 41
    const v0, 0x7f020043

    invoke-virtual {p0, v0}, Lcom/glympse/android/glympse/DlgFacebookSettings;->SetTitleIcon(I)V

    .line 42
    const v0, 0x7f0a003c

    invoke-virtual {p0, v0}, Lcom/glympse/android/glympse/DlgFacebookSettings;->SetTitleText(I)V

    .line 44
    iput-boolean p2, p0, Lcom/glympse/android/glympse/DlgFacebookSettings;->m_fAddRecipientWhenDone:Z

    .line 46
    invoke-virtual {p0, p0}, Lcom/glympse/android/glympse/DlgFacebookSettings;->SetDlgShellListener(Lcom/glympse/android/glympse/DlgShell$DlgShellListener;)V

    .line 48
    iget-object v0, p0, Lcom/glympse/android/glympse/DlgFacebookSettings;->m_oViewGroupPanel:Landroid/view/ViewGroup;

    const v1, 0x7f0c0022

    invoke-virtual {v0, v1}, Landroid/view/ViewGroup;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/TextView;

    iput-object v0, p0, Lcom/glympse/android/glympse/DlgFacebookSettings;->m_oTextStatus:Landroid/widget/TextView;

    .line 49
    iget-object v0, p0, Lcom/glympse/android/glympse/DlgFacebookSettings;->m_oViewGroupPanel:Landroid/view/ViewGroup;

    const v1, 0x7f0c0004

    invoke-virtual {v0, v1}, Landroid/view/ViewGroup;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/TextView;

    iput-object v0, p0, Lcom/glympse/android/glympse/DlgFacebookSettings;->m_oTextName:Landroid/widget/TextView;

    .line 50
    iget-object v0, p0, Lcom/glympse/android/glympse/DlgFacebookSettings;->m_oViewGroupPanel:Landroid/view/ViewGroup;

    const v1, 0x7f0c0024

    invoke-virtual {v0, v1}, Landroid/view/ViewGroup;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/Spinner;

    iput-object v0, p0, Lcom/glympse/android/glympse/DlgFacebookSettings;->m_oSpinnerScope:Landroid/widget/Spinner;

    .line 52
    iget-object v0, p0, Lcom/glympse/android/glympse/DlgFacebookSettings;->m_oViewGroupPanel:Landroid/view/ViewGroup;

    const v1, 0x7f0c0023

    invoke-virtual {v0, v1}, Landroid/view/ViewGroup;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/Button;

    iput-object v0, p0, Lcom/glympse/android/glympse/DlgFacebookSettings;->m_oButtonAction:Landroid/widget/Button;

    .line 53
    iget-object v0, p0, Lcom/glympse/android/glympse/DlgFacebookSettings;->m_oButtonAction:Landroid/widget/Button;

    new-instance v1, Lcom/glympse/android/glympse/DlgFacebookSettings$OnClickListenerSignInOut;

    invoke-direct {v1, p0, v2}, Lcom/glympse/android/glympse/DlgFacebookSettings$OnClickListenerSignInOut;-><init>(Lcom/glympse/android/glympse/DlgFacebookSettings;Lcom/glympse/android/glympse/DlgFacebookSettings$OnClickListenerSignInOut;)V

    invoke-virtual {v0, v1}, Landroid/widget/Button;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 56
    iget-object v0, p0, Lcom/glympse/android/glympse/DlgFacebookSettings;->m_oSpinnerScope:Landroid/widget/Spinner;

    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v1

    iget-object v1, v1, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    iget v1, v1, Lcom/glympse/platform/Config;->m_eFacebookScope:I

    invoke-virtual {v0, v1}, Landroid/widget/Spinner;->setSelection(I)V

    .line 58
    sget-object v0, Lcom/glympse/android/glympseservice/GlympseService;->ms_oThis:Lcom/glympse/android/glympseservice/GlympseService;

    invoke-virtual {v0}, Lcom/glympse/android/glympseservice/GlympseService;->GetFacebook()Lcom/glympse/android/glympseservice/FacebookWrapper;

    move-result-object v0

    invoke-virtual {v0, p0}, Lcom/glympse/android/glympseservice/FacebookWrapper;->SetFacebookStatusChange(Lcom/glympse/android/glympseservice/FacebookWrapper$FacebookStatusChange;)V

    .line 61
    iget-object v0, p0, Lcom/glympse/android/glympse/DlgFacebookSettings;->m_oViewGroupPanel:Landroid/view/ViewGroup;

    const v1, 0x7f0c0025

    invoke-virtual {v0, v1}, Landroid/view/ViewGroup;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/TextView;

    .line 62
    invoke-virtual {p0}, Lcom/glympse/android/glympse/DlgFacebookSettings;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-virtual {v1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v1

    const v2, 0x7f0a00a3

    invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v1

    .line 61
    invoke-static {v1}, Landroid/text/Html;->fromHtml(Ljava/lang/String;)Landroid/text/Spanned;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 64
    invoke-virtual {p0}, Lcom/glympse/android/glympse/DlgFacebookSettings;->UpdateControls()V

    .line 65
    return-void
.end method


# virtual methods
.method public OnCancel(Lcom/glympse/android/glympse/DlgShell;)V
    .locals 0
    .parameter "oDlgShell"

    .prologue
    .line 108
    return-void
.end method

.method public OnDismissed(Lcom/glympse/android/glympse/DlgShell;Z)V
    .locals 5
    .parameter "oDlgShell"
    .parameter "fOk"

    .prologue
    const/4 v4, 0x0

    .line 113
    sget-object v1, Lcom/glympse/android/glympseservice/GlympseService;->ms_oThis:Lcom/glympse/android/glympseservice/GlympseService;

    invoke-virtual {v1}, Lcom/glympse/android/glympseservice/GlympseService;->GetFacebook()Lcom/glympse/android/glympseservice/FacebookWrapper;

    move-result-object v1

    invoke-virtual {v1, v4}, Lcom/glympse/android/glympseservice/FacebookWrapper;->SetFacebookStatusChange(Lcom/glympse/android/glympseservice/FacebookWrapper$FacebookStatusChange;)V

    .line 116
    iget-object v1, p0, Lcom/glympse/android/glympse/DlgFacebookSettings;->m_oSpinnerScope:Landroid/widget/Spinner;

    invoke-virtual {v1}, Landroid/widget/Spinner;->getSelectedItemPosition()I

    move-result v0

    .line 117
    .local v0, eFacebookScope:I
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v1

    iget-object v1, v1, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    iget v1, v1, Lcom/glympse/platform/Config;->m_eFacebookScope:I

    if-eq v1, v0, :cond_0

    .line 119
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v1

    iget-object v1, v1, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    iput v0, v1, Lcom/glympse/platform/Config;->m_eFacebookScope:I

    .line 120
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v1

    iget-object v1, v1, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    invoke-virtual {v1}, Lcom/glympse/platform/Config;->Save()V

    .line 124
    :cond_0
    iget-boolean v1, p0, Lcom/glympse/android/glympse/DlgFacebookSettings;->m_fAddRecipientWhenDone:Z

    if-eqz v1, :cond_1

    sget-object v1, Lcom/glympse/android/glympse/Glympse;->ms_oThis:Lcom/glympse/android/glympse/Glympse;

    invoke-virtual {v1}, Lcom/glympse/android/glympse/Glympse;->GetCurrentEView()Lcom/glympse/android/glympse/Glympse$EViews;

    move-result-object v1

    sget-object v2, Lcom/glympse/android/glympse/Glympse$EViews;->SendGlympse:Lcom/glympse/android/glympse/Glympse$EViews;

    if-ne v1, v2, :cond_1

    .line 125
    sget-object v1, Lcom/glympse/android/glympseservice/GlympseService;->ms_oThis:Lcom/glympse/android/glympseservice/GlympseService;

    invoke-virtual {v1}, Lcom/glympse/android/glympseservice/GlympseService;->GetFacebook()Lcom/glympse/android/glympseservice/FacebookWrapper;

    move-result-object v1

    invoke-virtual {v1}, Lcom/glympse/android/glympseservice/FacebookWrapper;->IsSignedIn()Z

    move-result v1

    if-eqz v1, :cond_1

    .line 127
    sget-object v1, Lcom/glympse/android/glympse/Glympse;->ms_oThis:Lcom/glympse/android/glympse/Glympse;

    iget-object v1, v1, Lcom/glympse/android/glympse/Glympse;->m_oViewSendGlympse:Lcom/glympse/android/glympse/ViewSendGlympse;

    new-instance v2, Lcom/glympse/platform/common/Recipient;

    const/4 v3, 0x5

    invoke-direct {v2, v3}, Lcom/glympse/platform/common/Recipient;-><init>(I)V

    invoke-virtual {v1, v2}, Lcom/glympse/android/glympse/ViewSendGlympse;->AddRecipient(Lcom/glympse/platform/common/Recipient;)V

    .line 130
    :cond_1
    const/4 v1, 0x0

    iput-boolean v1, p0, Lcom/glympse/android/glympse/DlgFacebookSettings;->m_fAddRecipientWhenDone:Z

    .line 131
    iput-object v4, p0, Lcom/glympse/android/glympse/DlgFacebookSettings;->m_oTextStatus:Landroid/widget/TextView;

    .line 132
    iput-object v4, p0, Lcom/glympse/android/glympse/DlgFacebookSettings;->m_oTextName:Landroid/widget/TextView;

    .line 133
    iput-object v4, p0, Lcom/glympse/android/glympse/DlgFacebookSettings;->m_oButtonAction:Landroid/widget/Button;

    .line 134
    iput-object v4, p0, Lcom/glympse/android/glympse/DlgFacebookSettings;->m_oSpinnerScope:Landroid/widget/Spinner;

    .line 135
    return-void
.end method

.method public OnOk(Lcom/glympse/android/glympse/DlgShell;)V
    .locals 0
    .parameter "oDlgShell"

    .prologue
    .line 103
    return-void
.end method

.method public StatusChanged()V
    .locals 1

    .prologue
    .line 162
    const-string v0, "###: StatusChanged"

    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/String;)V

    .line 163
    invoke-virtual {p0}, Lcom/glympse/android/glympse/DlgFacebookSettings;->UpdateControls()V

    .line 164
    return-void
.end method

.method protected UpdateControls()V
    .locals 3

    .prologue
    const/16 v2, 0x8

    .line 70
    sget-object v0, Lcom/glympse/android/glympseservice/GlympseService;->ms_oThis:Lcom/glympse/android/glympseservice/GlympseService;

    invoke-virtual {v0}, Lcom/glympse/android/glympseservice/GlympseService;->GetFacebook()Lcom/glympse/android/glympseservice/FacebookWrapper;

    move-result-object v0

    invoke-virtual {v0}, Lcom/glympse/android/glympseservice/FacebookWrapper;->IsSignedIn()Z

    move-result v0

    if-eqz v0, :cond_1

    .line 72
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v0

    iget-object v0, v0, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    iget-object v0, v0, Lcom/glympse/platform/Config;->m_strFacebookName:Ljava/lang/String;

    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->IsEmpty(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 74
    iget-object v0, p0, Lcom/glympse/android/glympse/DlgFacebookSettings;->m_oTextStatus:Landroid/widget/TextView;

    const v1, 0x7f0a00a6

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(I)V

    .line 76
    iget-object v0, p0, Lcom/glympse/android/glympse/DlgFacebookSettings;->m_oTextName:Landroid/widget/TextView;

    invoke-virtual {v0, v2}, Landroid/widget/TextView;->setVisibility(I)V

    .line 77
    iget-object v0, p0, Lcom/glympse/android/glympse/DlgFacebookSettings;->m_oTextName:Landroid/widget/TextView;

    const-string v1, ""

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 87
    :goto_0
    iget-object v0, p0, Lcom/glympse/android/glympse/DlgFacebookSettings;->m_oButtonAction:Landroid/widget/Button;

    const v1, 0x7f0a00a5

    invoke-virtual {v0, v1}, Landroid/widget/Button;->setText(I)V

    .line 98
    :goto_1
    return-void

    .line 81
    :cond_0
    iget-object v0, p0, Lcom/glympse/android/glympse/DlgFacebookSettings;->m_oTextStatus:Landroid/widget/TextView;

    const v1, 0x7f0a00a7

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(I)V

    .line 83
    iget-object v0, p0, Lcom/glympse/android/glympse/DlgFacebookSettings;->m_oTextName:Landroid/widget/TextView;

    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v1

    iget-object v1, v1, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    iget-object v1, v1, Lcom/glympse/platform/Config;->m_strFacebookName:Ljava/lang/String;

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 84
    iget-object v0, p0, Lcom/glympse/android/glympse/DlgFacebookSettings;->m_oTextName:Landroid/widget/TextView;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setVisibility(I)V

    goto :goto_0

    .line 91
    :cond_1
    iget-object v0, p0, Lcom/glympse/android/glympse/DlgFacebookSettings;->m_oTextStatus:Landroid/widget/TextView;

    const v1, 0x7f0a00a8

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(I)V

    .line 93
    iget-object v0, p0, Lcom/glympse/android/glympse/DlgFacebookSettings;->m_oTextName:Landroid/widget/TextView;

    invoke-virtual {v0, v2}, Landroid/widget/TextView;->setVisibility(I)V

    .line 94
    iget-object v0, p0, Lcom/glympse/android/glympse/DlgFacebookSettings;->m_oTextName:Landroid/widget/TextView;

    const-string v1, ""

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 96
    iget-object v0, p0, Lcom/glympse/android/glympse/DlgFacebookSettings;->m_oButtonAction:Landroid/widget/Button;

    const v1, 0x7f0a00a4

    invoke-virtual {v0, v1}, Landroid/widget/Button;->setText(I)V

    goto :goto_1
.end method
